//
//  ExceptionViewController.m
//  MyProject
//
//  Created by yun on 2018/5/29.
//  Copyright © 2018年 yun. All rights reserved.
//

#import "ExceptionViewController.h"

@interface ExceptionViewController ()

@end

@implementation ExceptionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // 控制台输出日志就是NSException产生的
    [NSException exceptionWithName:NSInternalInconsistencyException reason:@"" userInfo:nil];
    // 方式1
    @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"" userInfo:nil];
    // 方法2
    @try{
        // 调用方法
    } @catch(NSException *exception){
        // 异常
    } @finally{
        // 补救或提示操作，一定执行
    }
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
